<!DOCTYPE html>
<html>
<head>
    <title>erp订单生产表</title>
    <#include "/header.html">
    <!--Lodop.js 打印插件-->
    <script src="${request.contextPath}/statics/plugins/Lodop/LodopFuncs.js"></script>
    <!-- 图片预览 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/viewer/viewer.min.css">
    <script src="${request.contextPath}/statics/plugins/viewer/viewer.min.js"></script>
    <style>
        #jqGrid tr td{
            vertical-align: middle;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <!-- 查询 start -->
            <form class="form-inline" role="form">
                <a class="btn btn-default btn-sm" @click="reset"><i class="fa fa-refresh"></i></a>

                <a class="btn btn-primary btn-sm" @click="send">添加物流</a>

                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.orderNo"placeholder="订单号">
                </div>&nbsp;&nbsp;&nbsp;

                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.productionStatus">
                        <option value="">生产状态</option>
                        <option v-for="item in e.orderProductionStatusEnum" :value="item.id">{{item.describe}}</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.shipStatus">
                        <option value="">发货状态</option>
                        <option value="0">未发货</option>
                        <option value="1">已发货</option>
                        <option value="2">部分发货</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <input class="form-control input-sm" v-model="q.beginAllotTime" @click="checkBeginDate" placeholder="分配时间" />
                    <label>至</label>
                    <input class="form-control input-sm" v-model="q.endAllotTime" @click="checkEndDate" placeholder="分配时间"/>
                </div>&nbsp;&nbsp;&nbsp;

                <a class="btn btn-default btn-sm" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
                <a class="btn btn-default btn-sm" @click="exportExcel"><i class="fa fa-sign-out"></i>&nbsp;导出</a>
            </form>
            <!-- 查询 end -->
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <!-- 物流发货 -->
    <div v-show="!showList">
        <form class="form-group">
            <!-- 订单信息 start -->
            <div class="panel panel-default">
                <div class="panel-heading">
                    订单信息
                </div>
                <div class="panel-body">
                    <div class="row" style="line-height: 25px">
                        <div class="col-md-3 text-center">订单号：{{erpOrder.orderNo}}</div>
                        <div class="col-md-3 text-center">会员名：{{erpOrder.memberName}}</div>
                        <div class="col-md-3 text-center">订单金额：{{erpOrder.totalAmount}}</div>
                        <div class="col-md-3 text-center">送货方式：{{erpOrder == null ? '' : (erpOrder.sendType == true ? "自提" : "非自提") }}</div>
                    </div>

                </div>
            </div>
            <!-- 订单信息 end -->
            <!-- 发货信息 start -->
            <div class="panel panel-default">
                <div class="panel-heading">
                    发货信息
                </div>
                <div class="panel-body" style="line-height: 35px">
                    <div class="col-md-3" style="line-height: 45px">
                        <div class="row">
                            <div class="col-md-3 text-right"><span style="color: red">*&nbsp;</span>发货类型：</div>
                            <div class="col-md-9">
                                <el-radio-group v-model="erpLogisticsEntity.sendType" @change="sendTypeChange" size="mini">
                                    <el-radio :label="1" border>发票</el-radio>
                                    <el-radio :label="2" border>样品</el-radio>
                                    <el-radio :label="3" border>订单</el-radio>
                                </el-radio-group>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right"><span style="color: red">*&nbsp;</span>物流类型：</div>
                            <div class="col-md-9">
                                <el-radio-group v-model="erpLogisticsEntity.logiType" size="mini">
                                    <el-radio :label="1" border>呼叫快递</el-radio>
                                    <el-radio :label="2" border>添加物流</el-radio>
                                    <el-radio :label="3" border>自提</el-radio>
                                </el-radio-group>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right"><span style="color: red" v-if="erpLogisticsEntity.logiType === 3?false:true">*&nbsp;</span>物流方式：</div>
                            <div class="col-md-9">
                                <el-select v-model="erpLogisticsEntity.logisticsId" @change="logiTypeChange" filterable placeholder="请选择"
                                           size="mini">
                                    <el-option v-for="item in logisticsTypeList" :key="item.logisticsId" :label="item.logisticsName" :value="item.logisticsId" />
                                </el-select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3" style="line-height: 45px">
                        <div class="row" v-show="showLogiNo">
                            <div class="col-md-3 text-right">配送单号：</div>
                            <div class="col-md-9">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.logiNo" placeholder="配送单号" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right">配送费用：</div>
                            <div class="col-md-9">
                                <input type="number" class="form-control input-sm" v-model="erpLogisticsEntity.logiCost" placeholder="配送费用" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-3 text-right">配送备注：</div>
                            <div class="col-md-9 text-right">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.logiRemark" placeholder="配送备注" />
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-4 text-right"><span style="color: red">*&nbsp;</span>收货人：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toPeople" placeholder="收货人" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right"><span style="color: red">*&nbsp;</span>收货联系方式：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toPhone" value="{{erpOrder.shipName}}"
                                       placeholder="收货联系方式" />
                            </div>
                        </div>
                        <!--<div class="row">
                            <div class="col-md-4 text-right"><span style="color: red">*&nbsp;</span>收货地区：</div>
                            <div class="col-md-8 ">
                                <el-cascader placeholder="试试搜索：武汉市" size="small" filterable style="width: 100%" :options="area" @change="handleItemChange">

                                </el-cascader>
                            </div>
                        </div>-->
                        <div class="row">
                            <div class="col-md-4 text-right">收货地区：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toArea"
                                       placeholder="收货地区"/>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-4 text-right">收货地址：</div>
                            <div class="col-md-8 ">
                                <input type="text" class="form-control input-sm" v-model="erpLogisticsEntity.toAddress" placeholder="收货地址" />
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="row">
                            <div class="col-md-5 text-right">发货人：</div>
                            ziyun
                        </div>
                        <div class="row">
                            <div class="col-md-5 text-right">联系方式：</div>
                            400-000-2519
                        </div>
                        <div class="row">
                            <div class="col-md-5 text-right">发货地址：</div>
                            江汉区常青三路17B9-13
                        </div>
                    </div>
                </div>
            </div>
            <!-- 发货信息 end -->
            <!-- 发货明细 start -->
            <div class="panel panel-default" v-show="showSendDetail">
                <div class="panel-heading">
                    发货明细
                </div>
                <div class="panel-body">
                    <div class="form-group">
                        <el-table border stripe ref="multipleTable" :data="erpOrderItem" @selection-change="orderItemSelectionChange"
                                  tooltip-effect="dark" size="mini">
                            <el-table-column type="selection" width="55"></el-table-column>
                            <el-table-column prop="eoItemId" label="商品ID" width="100"></el-table-column>
                            <el-table-column prop="name" label="商品名称" show-overflow-tooltip></el-table-column>
                            <el-table-column prop="addon" label="规格属性" show-overflow-tooltip></el-table-column>
                            <el-table-column prop="productId" label="商品编号" width="100"></el-table-column>
                            <el-table-column prop="unit" label="单位" width="60"></el-table-column>
                            <el-table-column prop="craftsNames" label="工艺" width="120"></el-table-column>
                            <el-table-column prop="nums" label="数量" width="100" fixed="right">
                                <template slot-scope="scope">
                                    <el-input type="number" v-model="scope.row.nums" size="small" min="0" :max="scope.row.nums" :value="scope.row.nums"></el-input>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </div>
            </div>
            <!-- 发货明细 end -->
            <div class="grid-btn text-center">
                <a class="btn btn-primary btn-sm" @click="saveLogistics">确认保存</a>
                <a class="btn btn-warning btn-sm" @click="reback">返回</a>
            </div>
        </form>
    </div>

    <!--打印送货单-->
    <div id="printGoods" style="display: none;">
        <div id="printbox">

            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="33%">
                    </td>
                    <td width="33%" align="center">
                        <h1 style="font-size: 3em;">送 货 单</h1>
                    </td>
                    <td align="right" v-model="erpOrder.orderNo">NO.{{erpOrder.orderNo}}</td>
                </tr>
            </table>
            <br>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="45%">客户名称：{{erpOrder.shipName}}</td>
                    <td width="33%">业务员：{{erpOrder.merchantsSalesMan}}</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <!--<td>客户地址：{{erpOrder.shipArea}}{{erpOrder.shipAddr}}</td>-->
                    <td width="45%">联系电话：{{erpOrder.shipMobile}}</td>
                    <td width="33%">日期：{{erpOrder.paymentTime}}</td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="3">客户地址：{{erpOrder.shipArea}}{{erpOrder.shipAddr}}</td>
                </tr>
            </table>
            <br>
            <table width="100%" border="1" align="center" cellpadding="0" cellspacing="0">
                <tr class="table_data_title">
                    <td align="center">序号</td>
                    <td>产品名称</td>
                    <td>规格</td>
                    <td>生产工艺</td>
                    <td align="center">单位</td>
                    <td align="center">款式数量</td>
                    <td align="center">原价</td>
                    <td align="center">现价</td>
                    <td align="center">小计</td>
                </tr>
                <tr v-for="(orderItem,index) of erpOrderItem">
                    <td align="center">{{index + 1}}</td>
                    <td align="center">{{orderItem.name}}</td>
                    <td align="center">{{orderItem.addon}}</td>
                    <td align="center">{{orderItem.craftsNames}}</td>
                    <td align="center">{{orderItem.unit}}</td>
                    <td align="center">{{orderItem.nums}}</td>
                    <td align="center">￥{{orderItem.price}}</td>
                    <td align="center">￥{{orderItem.price}}</td>
                    <td align="center">￥{{orderItem.amount}}</td>
                </tr>
                <tr>
                    <td colspan="9"> 运费：￥{{erpOrder.costFreight}}&nbsp;&nbsp;&nbsp;&nbsp;订单减免：￥{{erpOrder.discount}}
                    </td>
                </tr>
                <tr>
                    <td colspan="8">合计（大写）：{{smalltoBIG(erpOrder.payableAmount)}}</td>
                    <td align="center">￥{{erpOrder.payableAmount}}</td>
                </tr>
            </table>
            <br>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="10%">备注：{{erpOrder.memo}}<</td>
                    <td>是否带发票：
                        <span v-if="erpOrder.sendTax==1">带发票</span>
                        <span v-else>不带发票</span>
                    </td>
                </tr>
            </table>
            <br>
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="50%">送货人：</td>
                    <td width="50%">客户签章：</td>
                </tr>
            </table>
        </div>
    </div>

    <!--打印快递单start-->
    <el-dialog title="快递单" :visible.sync="EMSView" width="1100px" modal="false">
        <el-form :inline="true" class="demo-form-inline">
            <label>寄件人信息</label><br>
            <el-form-item label="姓名">
                <el-input v-model="sellerInfo.sellerName" placeholder="姓名"></el-input>
            </el-form-item>
            <el-form-item label="电话">
                <el-input v-model="sellerInfo.sellerMobile" placeholder="电话"></el-input>
            </el-form-item>
            <el-form-item label="邮编" v-if="false">
                <el-input v-model="sellerInfo.sellerMobile" placeholder="邮编"></el-input>
            </el-form-item>
            <el-form-item label="地区">
                <el-input v-model="sellerInfo.area" placeholder="地区"></el-input>
            </el-form-item>
            <el-form-item label="地址">
                <el-input v-model="sellerInfo.addr" placeholder="地址" style="width: 458px"></el-input>
            </el-form-item>
            <el-form-item label="单位">
                <el-input v-model="sellerInfo.doorheadName" placeholder="单位" style="width: 458px"></el-input>
            </el-form-item>
            <label>收件人信息</label><br>
            <el-form-item label="姓名">
                <el-input v-model="erpOrder.shipName" placeholder="姓名"></el-input>
            </el-form-item>
            <el-form-item label="电话">
                <el-input v-model="erpOrder.shipMobile" placeholder="电话"></el-input>
            </el-form-item>
            <el-form-item label="地区">
                <el-input v-model="erpOrder.shipArea" placeholder="地区"></el-input>
            </el-form-item>
            <el-form-item label="邮编">
                <el-input v-model="erpOrder.shipZip" placeholder="邮编"></el-input>
            </el-form-item>
            <el-form-item label="地址">
                <el-input v-model="erpOrder.shipAddr" placeholder="地址" style="width: 458px"></el-input>
            </el-form-item>
            <el-form-item label="单位">
                <el-input v-model="erpOrder.memberName" placeholder="单位" style="width: 458px"></el-input>
            </el-form-item>
        </el-form>
        <label>快递单模板</label>
        <template>
            <el-radio v-model="radio" label="1">韵达</el-radio>
            <el-radio v-model="radio" label="2">中通</el-radio>
            <el-radio v-model="radio" label="3">速尔</el-radio>
        </template>
        <span slot="footer" class="dialog-footer">
					<el-button size="small" type="primary" @click="printEMS">打印</el-button>
					<el-button size="small" @click="EMSView = false">取消</el-button>
				</span>
    </el-dialog>
    <!--打印快递单end-->
</div>

<script src="${request.contextPath}/statics/js/modules/production/yangluoproduction.js?_${.now?long}"></script>
</body>
</html>
